/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86187
 * Date: 2022-04-17
 * Time: 23:34
 */

//Scanner scan = new Scanner(System.in);

import java.util.Scanner;

public class RecNum2 {

    /**
     * 递归输出 n 的每一位
     * @param n
     */
    public static void recNum(int n) {

        if(n > 9) {
            recNum(n / 10);
        }

        System.out.println(n % 10);
    }

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int n = scan.nextInt();

        recNum(n);
    }
}
